<html>
<head>
  <title>Edit List of Children</title>
	
 <link rel="stylesheet" type="text/css" id="stylesheet"
       href="/styles/default.css" />	
</head>
<body>
<h1>Edit List of Children</h1>	    
{{$topic := .topic}}
{{$childLinks := .topic.childLinks}}
{{$le := length $childLinks}} 
{{$n := minus $le 1}}
<p>Child topics of topic <b>{{$topic.title}}</b>:</p>
<table>
{{range $i,$cl := .topic.childLinks}}
  {{$title := .child.title}}
  <form action="editChildrenAction" method="POST">
  <input type="hidden" name="topic" value="{{urlPath $topic}}" />	
  <input type="hidden" name="ordinal" value="{{$i}}" />
  <tr>
	<td>{{$i}}</td>	
	<td>{{$title}}</td>
	<td>{{if gt $i 0}}<input type="submit" name="action" value=" ^ " title="Move child up" />{{end}}</td>
	<td>{{if lt $i $n}}<input type="submit" name="action" value=" v " title="Move child down" />{{end}}</td>	
	<td><input type="submit" name="action" value="-x-" title="Remove parent-child relationship" /></td>		
  </tr>
  </form>
{{end}}
</table>
<p style="text-align:right; width:95%;" >
	<form action="{{urlPath $topic}}" method="get">
    <input type="submit" value=" Ok " />		
	</form>
</p>	
</body>
</html>